{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Created by william from lexueoude.com. 更多正版技术视频讲解，公众号 1.乐学偶得（lexueoude）2.乐学FinTech (LoveShareFinTech)\n",
    "\n",
    "\n",
    "1.金融市场两方：\n",
    "\n",
    "买方 （Buy-side 一级市场、二级市场，组合策略思想）\n",
    "卖方 （Sell-side 做撮合，产品销售，产品设计（金融衍生品））\n",
    "\n",
    "2.量化的两派：\n",
    "\n",
    "P-Quant(真实概率) 买方\n",
    "**注意：你所认为的\"滑点\"，不一定是真的。注意你的对手方，获取行情tick级的与下单等操作的时间\n",
    "\n",
    "Q-Quant(风险中性) 卖方\n",
    "\n",
    "推荐网站：http://gouthamanbalaraman.com/\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "# 导入常用库\n",
    "import QuantLib as ql\n",
    "import pandas as pd\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "January 30th, 2022\n"
     ]
    }
   ],
   "source": [
    "# 时间相关操作，用的是Date构造器\n",
    "\n",
    "date = ql.Date(30,1,2022)\n",
    "\n",
    "print(date)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2022"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 反向获取date对象中的信息\n",
    "\n",
    "date.year()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "date.month()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "date.dayOfMonth()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "date.weekday() == ql.Sunday"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "PyCharm (sklearn)",
   "language": "python",
   "name": "pycharm-9607c1d0"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
